<?xml version="1.0"?>
<!--
	
                 Springs On Rails
                 Copyright [2007] [Sunny Liu]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.	
-->
<project name="spring-on-Rails" default="rideOnRails" basedir=".">	
  <property name="WebInf" value="<#noparse>${basedir}</#noparse>/WebContent/WEB-INF"/>
  <property name="clazzTarget" value="<#noparse>${WebInf}</#noparse>/classes"/>
  <property name="libTarget" value="<#noparse>${WebInf}</#noparse>/lib"/>
  <#noparse>	 
  <target name="prepare">
  	<delete includeemptydirs="true">
    	<fileset dir="${clazzTarget}" includes="**/*"/>
  	</delete>
  </target>	
	<target name="compile" depends="prepare">		
		<javac srcdir="${basedir}/JavaSource"		         
				destdir="${clazzTarget}"		         
		         source="1.4"
		         target="1.4"
		>
			<classpath>	
			   <fileset dir="${libTarget}">
				 <include name="*.jar"/>
			  </fileset>
			  </classpath>
			</javac>
		<!-- 
			Copy all non java related files to classes folder that may be required
			for classloader.
		-->
		<copy todir="${clazzTarget}">
		    <fileset dir="${basedir}/JavaSource">	      
			  <exclude name="**/*.java"/>
			  <include name="**/*.*"/>
		    </fileset>
		</copy>
	</target>
	</#noparse>	
	<target name="rideOnRails" depends="compile">
		<war destfile="${projectName}.war" webxml="<#noparse>${WebInf}</#noparse>/web.xml">
		   <fileset dir="<#noparse>${basedir}</#noparse>/WebContent">		   		
		   		<exclude name="**/web.xml"/>
		   </fileset>		 
		</war>		
	</target>	
</project>

